<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/9/19
 * Time: 11:54
 */
$arr = [63,12,4,2,3,1,3];
//1 2 3 4
for($j=0;$j<count($arr)-1;$j++){

    for($i=0;$i<count($arr)-$j-1;$i++){
        echo $i."-";
        if ($arr[$i] > $arr[$i+1]){
            $tmp = $arr[$i];
            $arr[$i] = $arr[$i+1];
            $arr[$i+1] = $tmp;
        }
    }
    var_dump($arr);
}


